<template>
	<view>
		<view class='rabe-wx'>读书推荐值{{ratedata.recommendValue || 60}}%</view>
		<view class="rate-box">
			<view class="rote-box-left">
				<image src="@/static/tuijian.png" mode="" style='width:230rpx;height:56rpx;'></image>
				<view>{{ratedata.commentCount || 200}}人点评 </view>
			</view>
			<view class="progress">
				<view class="progress-item">
					<text>推荐</text>
					<progress class="progressbar" :percent="recommendCounts" stroke-width="4" border-radius="2" activeColor="#999999"/>
				</view>
				<view class="progress-item">
					<text>一般</text>
					<progress class="progressbar" :percent="commonCounts" stroke-width="4"  border-radius="2" activeColor="#999999"/>
				</view>
				<view class="progress-item">
					<text>不行</text>
					<progress class="progressbar" :percent="badCounts" stroke-width="4" border-radius="2" activeColor="#999999"/>
				</view>
			</view>
		</view>
		<view class="rate-ul">
			<text>推荐({{ratedata.recommendCount || 160}})</text>
			<text>一般({{ratedata.commonCount || 30}})</text>
			<text>不行({{ratedata.badCount || 10}})</text>
		</view>
	</view>
</template>

<script>
	export default {
		props: {
			ratedata:{
				type: Object
			}
		},
		watch: {
		},
		
		data() {
			return {
				
			}
		},
		mounted() {
		},
		computed: {
		    recommendCounts() {
		      return Math.ceil(this.ratedata.recommendCount / (this.ratedata.recommendCount+this.ratedata.commonCount+this.ratedata.badCount) *100) || 80;
		    },
			commonCounts() {
			  return Math.ceil(this.ratedata.commonCount / (this.ratedata.recommendCount+this.ratedata.commonCount+this.ratedata.badCount) *100) || 15;
			},
			badCounts() {
			  return Math.ceil(this.ratedata.badCount / (this.ratedata.recommendCount+this.ratedata.commonCount+this.ratedata.badCount) *100) || 5;
			}
		},
		
		methods: {
			
		}
	};
</script>

<style scoped>
	.rabe-wx{
		height:50rpx;
		line-height:50rpx;
		margin-bottom:20rpx;
		font-size:36rpx;
		color:#4E5969;
		font-weight: bold;
	}
	.rate-box{
		display:flex;
		justify-content: space-between;
		color:#4E5969;
	}
	.rate-box .rote-box-left{
		width:40%;
		display:flex;
		flex-direction: column;
		justify-content: space-between;
		align-items: flex-start;
		padding:5rpx;
		font-size:28rpx;
	}
	.rate-box .progress{
		width:58%;
	}
	.rate-box .progress .progress-item{
		line-height:40rpx;
		line-height:40rpx;
		display:flex;
		justify-content: space-between;
	}
	.progress-item .progressbar{
		width:80%;
	}
	.rate-ul{
		display:flex;
		justify-content: space-between;
		margin-top:20rpx;
	}
	.rate-ul text{
		padding:8rpx 32rpx;
		font-size:28rpx;
		border-radius:28rpx;
		background:#F6F6F6;
		font-weight:500;
	}
</style>